package com.sbm.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping("/jsp")
public class JspPageController {

    @GetMapping("/welcome/{name}")
    public ModelAndView welcome(@PathVariable("name") String name) {
        ModelAndView mav = new ModelAndView("index");
        mav.addObject("name", name);
        return mav;
    }
}
